package spring.batch.noLiner;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.listener.StepExecutionListenerSupport;

/**
 * @Author: huhx
 * @Date: 2017-11-02 下午 7:35
 */
public class FirstStepListener extends StepExecutionListenerSupport {
    private String status;

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        if (status.equals("1")) {
            return new ExitStatus("OWN STATUS");
        } else if (status.equals("2")) {
            return new ExitStatus("NO STATUS");
        }
        return ExitStatus.COMPLETED;
    }
}
